<template>
	<view>
		<view v-html="platformData.content|| '暂无内容'"></view> 
	</view>
</template>

<script>
import {list} from '@/api/platformApi.js'
	export default {
		data() {
			return {
				platformData: [], // 存储返回的全部数据
				isLoading: false,
				error: null
			}
		},
		onLoad() {
		    this.fetchPlatform()
		  },
		methods: {
			async fetchPlatform() {
			      this.isLoading = true
			      this.error = null
			      
			      try {
			        // 1. 调用接口获取数据
			        const res = await list(null)
			        
			        // 2. 处理响应数据
			        if (res.code == '200' && res.data) {
			          // this.platformData = res.data
					  
					  this.platformData = res.data[0] || {};
					  console.log('数据结构:', this.platformData)
			        } else {
			          throw new Error(res.message || '获取数据失败')
			        }
			      } catch (err) {
			        console.error('请求失败:', err)
			        this.error = err.message
			        this.content = '数据加载失败，请重试'
			      } finally {
			        this.isLoading = false
			      }
			 }
		}
	}
</script>

<style>

</style>
